const PROXY_HOST = process.env.PROXY_HOST;
const NEXT_PUBLIC_ENV = process.env.NEXT_PUBLIC_ENV;
const destinationPath = NEXT_PUBLIC_ENV === "development" ? "" : "api/";

module.exports = {
    reactStrictMode: false,
    experimental: {
        forceSwcTransforms: true,
    },
    async rewrites() {
        return {
            fallback: [
                {
                    source: '/api/:path*',
                    destination: `${PROXY_HOST}/${destinationPath}:path*`,
                }
            ],
        }
    },
}
